-
Notifications
You must be signed in to change notification settings - Fork 954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ruby 3 and kwargs #1158
base: master
Are you sure you want to change the base?
Conversation
We're going to need to explicitly separate kwargs and hash parameters to fix ruby 3 compatibility
@jdelStrother Could you fix the conflicts in this PR to make it mergable? This is working great for me on a Ruby 3.1 project, and I'd love to see it get released. |
If the maintainers are interested in merging this I’ll fix up the conflicts, but I’m no longer using DJ. Feel free to take over this branch if you’re more invested |
You should also pass add delayed_job/lib/delayed/message_sending.rb Lines 39 to 50 in b66bb64
|
I use this in production: define_method(with_method) do |*args, **kwargs|
curr_opts = opts.clone
curr_opts.each_key do |key|
next unless (val = curr_opts[key]).is_a?(Proc)
curr_opts[key] = if val.arity == 1
val.call(self)
else
val.call
end
end
delay(curr_opts).__send__(without_method, *args, **kwargs)
end |
Based on the work @webhoernchen started in #1130.
We've been running this in production for a month while upgrading an installation from ruby 2.7 to 3.0 without issue. I think I've managed to keep support for ruby 2.6, but haven't done much more than run the test suite on it.